#ifndef SALEWEIGHT_H
#define SALEWEIGHT_H

#include"../saleBase.h"

class SaleWeight:public SaleBase
{
public:
    SaleWeight(){
        class_type=CLASS_SALEWEIGHT;
        weight=1;
    }

    ~SaleWeight(){}

    /*
     * 获取用户选择规格重量等后的应付价格
     **/
    double getPayable(){ return weight*price; }

    virtual string toString()
    {
        string re = SaleBase::toString();
        re+="  *  "+QString::number(weight).toStdString();
        return re;
    }

    virtual void selectOne(){};

    virtual void del(){};

    virtual void insert(){};

    /*
     * 设置订购重量
     * */
    void setWeight(double weight_){weight=weight_;}

protected:
    double weight=1;
};

#endif // SALEWEIGHT_H
